// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class ResetJobRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>Specifies whether annotations that have been added by the<br/>user should be deleted along with any auto-generated annotations when the job is<br/>reset.</para>
	/// </summary>
	public bool? DeleteUserAnnotations { get => Q<bool?>("delete_user_annotations"); set => Q("delete_user_annotations", value); }

	/// <summary>
	/// <para>Should this request wait until the operation has completed before<br/>returning.</para>
	/// </summary>
	public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
}

/// <summary>
/// <para>Resets an anomaly detection job.<br/>All model state and results are deleted. The job is ready to start over as if<br/>it had just been created.<br/>It is not currently possible to reset multiple jobs using wildcards or a<br/>comma separated list.</para>
/// </summary>
public sealed partial class ResetJobRequest : PlainRequest<ResetJobRequestParameters>
{
	public ResetJobRequest(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.reset_job";

	/// <summary>
	/// <para>Specifies whether annotations that have been added by the<br/>user should be deleted along with any auto-generated annotations when the job is<br/>reset.</para>
	/// </summary>
	[JsonIgnore]
	public bool? DeleteUserAnnotations { get => Q<bool?>("delete_user_annotations"); set => Q("delete_user_annotations", value); }

	/// <summary>
	/// <para>Should this request wait until the operation has completed before<br/>returning.</para>
	/// </summary>
	[JsonIgnore]
	public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
}

/// <summary>
/// <para>Resets an anomaly detection job.<br/>All model state and results are deleted. The job is ready to start over as if<br/>it had just been created.<br/>It is not currently possible to reset multiple jobs using wildcards or a<br/>comma separated list.</para>
/// </summary>
public sealed partial class ResetJobRequestDescriptor : RequestDescriptor<ResetJobRequestDescriptor, ResetJobRequestParameters>
{
	internal ResetJobRequestDescriptor(Action<ResetJobRequestDescriptor> configure) => configure.Invoke(this);

	public ResetJobRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id jobId) : base(r => r.Required("job_id", jobId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningResetJob;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.reset_job";

	public ResetJobRequestDescriptor DeleteUserAnnotations(bool? deleteUserAnnotations = true) => Qs("delete_user_annotations", deleteUserAnnotations);
	public ResetJobRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion);

	public ResetJobRequestDescriptor JobId(Elastic.Clients.Elasticsearch.Serverless.Id jobId)
	{
		RouteValues.Required("job_id", jobId);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}